﻿using System;
using EasyStep.Attributes;
using EasyStep.TestExecution.Data;
using EasyStep.TestExecution.Interfaces;

using OpenQA.Selenium;
using EasyStep.TestActions.Utils;

namespace EasyStep.TestActions.Actions.RandomFill
{
    [TestAction(typeof(RandomFill), Name = "ByCss")]
    class RandomFillByCss : ITestAction<IWebDriver>
    {
        public void Execute(IWebDriver browser, TestStepResult data, IExecuteDataContext context)
        {
            browser.FindElement(By.CssSelector(data.Locator)).Clear();
            browser.FindElement(By.CssSelector(data.Locator)).SendKeys(ActionUtils.RandomString(data.Data));           
        }

       
    }
}
